package com.itheima.service.umsService.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.domain.db.ums.UmsAdminRoleRelation;
import com.itheima.mapper.umsMapper.UmsAdminRoleRelationMapper;
import com.itheima.service.umsService.UmsAdminRoleRelationService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author DogeGuo
 */
@DubboService
public class UmsAdminRoleRelationServiceImpl extends ServiceImpl<UmsAdminRoleRelationMapper, UmsAdminRoleRelation> implements UmsAdminRoleRelationService {
    @Autowired
    private UmsAdminRoleRelationMapper umsAdminRoleRelationMapper;


    //根据当前用户id,查询对应的角色集合
    @Override
    public List<UmsAdminRoleRelation> getRoles(Long adminId) {
        LambdaQueryWrapper<UmsAdminRoleRelation> lqw = new LambdaQueryWrapper<>();
        lqw.eq(UmsAdminRoleRelation::getAdminId,adminId);
        return umsAdminRoleRelationMapper.selectList(lqw);
    }

}
